home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: netcom.com!marnold
- From: marnold@netcom.com (Matt Arnold)
- Subject: Re: Help: What is WINSTUB.EXE
- Message-ID: <marnoldDLtzz1.Hvz@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- References: <310945D2.2BAC@eurobretagne.fr>
- Date: Sat, 27 Jan 1996 08:37:49 GMT
- Sender: marnold@netcom20.netcom.com
-
- Joδl Connault <conn1002@eurobretagne.fr> writes:
-
- >Hi everybody
-
- >I'm using Borland c++ 4.0 witn Win 95.
- >When compiling some of my previous projets,
- >I get this error: Unable to open "WINSTUB.EXE"
-
- >What does it mean?
-
- First, a bit of history. All 16-bit Windows programs are two
- programs in one! At the beginning of a Windows .EXE is a regular
- DOS program. Following the DOS program is the Windows program.
- When the Windows loader loads a program, it ignores the DOS program
- portion---or "stub". Likewise, the DOS loader doesn't care about
- the extra "junk" (the Windows portion) at the end of the file and
- simply runs the stub as a regular DOS program (it *is* a regular
- DOS program). Everything works out neatly.
-
- What does the embedded stub do? Well, ever wonder where the message
- "This program requires Microsoft Windows" comes from when you try
- to run a Windows program from the DOS prompt? Well, most Windows
- programs have their little DOS program stub do this. Windows
- itself does not display that message as many people assume. In fact,
- the stub doesn't have to print that message at all....you can use
- any DOS program for your stub. That's how the Windows SETUP.EXE
- program works. When you run it from Windows, you get the graphical
- Windows Setup window---obviously a Windows program. When you run it
- from DOS, you get the "white-on-blue" character-mode DOS version of
- Windows Setup. Swell, eh?
-
- Anyway, most modern compilers automatically insert the little DOS
- program that prints that standard message for you. However, older
- Borland tools required that you manually specify the stub program
- in the module definition file (.DEF) using the "STUB" keyword. The
- Borland tools came with the little program called WINSTUB.EXE,
- usually found in the BIN folder, that you were supposed to specify
- for the stub. If you run WINSTUB.EXE directly, you see...
-
- "This program requires Microsoft Windows."
-
- ...which you could have guessed if you've been following me so far.
-
-
- So...
-
- I suspect that one of the .DEF files in your old projects has a STUB
- entry that refers to WINSTUB.EXE and that you don't have a WINSTUB.EXE
- anywhere on your hard disk. Thus, the error message you got, "Cannot
- open WINSTUB.EXE".
-
- With Borland C++ 4.0, the STUB entry is no longer necessary. If you
- simply remove it, I bet your problem will go away. Better yet, you
- probably don't even need the .DEF file.
-
- Regards,
- -------------------------------------------------------------------------
- Matt Arnold | | ||| | |||| | | | || ||
- marnold@netcom.com | | ||| | |||| | | | || ||
- Boston, MA | 0 | ||| | |||| | | | || ||
- 617.389.7384 (h) 617.576.2760 (w) | | ||| | |||| | | | || ||
- C++, MIDI, Win32/95 developer | | ||| 4 3 1 0 8 3 || ||
- -------------------------------------------------------------------------
-